using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using FluentData;
using AdverseEventReportSystem.Model;
using AdverseEventReportSystem.Repository;

namespace AdverseEventReportSystem.Service 
{
 	public class AdverseEventYcFanKuiService  : BaseService<AdverseEventYcFanKui> {
    
        #region Update
        
		public static int Update(AdverseEventYcFanKui entity, IDbContext context = null) {
			return AdverseEventYcFanKuiRepository.GetInstance().Update(entity, context);
		}
        
        #endregion

        #region Add
		
        public static int Add(AdverseEventYcFanKui entity, IDbContext context = null) {
			return AdverseEventYcFanKuiRepository.GetInstance().Add(entity, context);
		}
        
        #endregion
        
        #region 获取单个实体 通过主键ID

	    /// <summary>
	    /// 获取单个实体 通过主键ID
	    /// </summary>
	    /// <param name="id">主键ID</param>
	    /// <param name="context">数据库连接对象</param>
	    /// <returns></returns>
	    public static AdverseEventYcFanKui GetQuerySingleByID(int id, IDbContext context = null) {
		    return AdverseEventYcFanKuiRepository.GetInstance().GetQuerySingleByID(id, context);
	    }
    
	    #endregion

    	#region 删除操作  通过ID

        /// <summary>
    	/// 删除操作  通过ID
	    /// </summary>
	    /// <param name="id">主键ID</param>
	    /// <param name="context">数据库对象</param>
	    /// <returns></returns>
	    public static int DelByID(int id, IDbContext context = null) {
		    return AdverseEventYcFanKuiRepository.GetInstance().DelByID(id, context);
	    }
    
        #endregion 
        
        #region 根据不良事件ID获取实体

        /// <summary>
        /// 根据不良事件ID获取实体
        /// </summary>
        /// <param name="eventId">不良事件ID</param>
        /// <param name="context">数据库连接对象</param>
        /// <returns></returns>
        public static AdverseEventYcFanKui GetQuerySingleByEventID(int eventId, IDbContext context = null)
        {
            return AdverseEventYcFanKuiRepository.GetInstance().GetQuerySingleByEventID(eventId, context);
        }

        #endregion

        #region 根据不良事件ID删除实体

        /// <summary>
        /// 根据不良事件ID删除实体
        /// </summary>
        /// <param name="id">不良事件ID</param>
        /// <param name="context">数据库连接对象</param>
        /// <returns></returns>
        public static int DelByEventID(int eventId, IDbContext context = null)
        {
            return AdverseEventYcFanKuiRepository.GetInstance().DelByEventID(eventId, context);
        }

        #endregion
	}
}





